<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>车辆人员出入管理平台系统</title>
<link rel="stylesheet" href="themes/default/easyui.css" />
<link rel="stylesheet" href="css/main.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.easyui.min.js"></script>
<script type="text/javascript">
	function connect() {
		console.log('load');
		var uri='ws://localhost:8090/vms/websocket';
		socket = new WebSocket(uri);
		socket.onopen = function() {
			console.log('连接');
			socket.send($("input[name=org]").val());
		};
		socket.onmessage=function(data){
			console.log(data.data);
		};
		socket.onclose=function(event){
			console.log(event.data);
		}
	}
	
	function send(){
		var msg=$("input[name=msg]").val();
		socket.send(msg);
	}
</script>
</head>
<body>
<input name='org'>

	<button onclick="connect()">连接</button>
	<input name='msg'>
	<button onclick="send()">发送</button>
</body>
</html>
